﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using CashFlow.Entities;
using Should.Fluent;

namespace CashFlow.Web.Tests
{
	[TestClass]
	public class AppIdentityTest
	{
		[TestMethod]
		public void Seting_ClaimedIdentifier_Parses_Provider_And_Encodes_Identifier()
		{
			var claimedIdentifier = @"https://me.yahoo.com/a/IOEYp8lj29Syy4rohS_RHC19tac-#4703d";

			var identity = new AppIdentity(claimedIdentifier);

			identity.Provider.Should().Equal("yahoo");
			identity.EncodedIdentifier.Should().Equal("1C519603695D3B7F10FF7BB1D793640A");
		}
	}
}
